<template>
	<view class="container">
		<view class="lost-found-list">
			<view class="item" v-for="(item, index) in myReturnList" :key="index" @click="goLostFoundDetail(item.foundId)">
				<image mode="aspectFill" :src="item.pic ? item.pic : '/static/images/icon/no-pic.png'"></image>
				<view class="text">
					<view class="title">
						{{item.title}}
					</view>
					<view class="content">{{item.content}}</view>
				</view>
			</view>
			
			<u-empty v-if="myReturnList.length == 0" mode="list"></u-empty>
			
			<u-toast ref="uToast" />
	
		</view>
	</view>
</template>

<script>
	import {
		getMyReturnList
	} from '@/api/lostFound.js'
	export default {
		data() {
			return {
				myReturnList: []
			}
		},
		methods: {
			getMyReturnList() {
				let params = {}
				getMyReturnList(params).then(res => {
					this.myReturnList = res.data
				})
			},
			// 导航到详情页
			goLostFoundDetail(foundId) {
				this.$u.route('/pages/lost-found-detail/lost-found-detail', {
					foundId: foundId
				})
			}
		},
		onLoad() {
			this.getMyReturnList()
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.getMyReturnList();
			uni.stopPullDownRefresh();
		}
	}
</script>


<style lang="scss">
	@import "./my-lost-found-return.scss";
</style>
